<%@ page title="" language="C#" masterpagefile="~/Visitor.master" autoeventwireup="true" inherits="Vtms, App_Web_xtpq4zcp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server"> 
    <%--  <script type="text/javascript" src="fusioncharts/fusioncharts.charts.js"--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">

    <style>
       #MainContent_chtCategoriesProductCountBarChart
       {
           width:100% !important;
       }
       #MainContent_Chart1
       {
         width:100% !important;  
       }
       .dash.txtdash{
           background-color:#FE4800;
       }
       .dash.txtdash i,.txtvt{
           color:#fff!important;
       }
       .tlt{
           color:#FE4800;
       }
       .dfg{
           color:#FE4800;
       }
   .config-btn {
    position: fixed;
    right: 0px;
    top: 163px;
    z-index: 8000;
    background: #fff;
    width: 20px;
    height: 30px;
}
.md-settings {
    font-size: 15px;
    padding-left: -40px;
    position: relative;
    left: -10px;
    top: -2px;
}
.collapse1 {
    position: fixed;
    right: 0px;
    top: 193px;
    z-index: 800;
    background: #fff;
    width: 290px;
    padding: 12px;
    border-radius: 4px;
    box-shadow: 0px 1px 7px 2px #00000036;
    padding-top: 0px !important;
}
.tab-content
{
    padding-top:20px;
}
.nav-tabs {
    border-bottom: 2px solid #e0e0e0;
    padding-top: 10px;
    padding-bottom: 0px;
}
.nav-tabs .active
{
  border-bottom: 2px solid #3949ab; 
  position: relative;
    top: 3px; 
}
.nav-tabs li a
{
     position: relative;
    top: 3px;
    color: #757575;  
    font-size:15px; 
}
 .active
{
 color:#3949ab !important;
}
.nav-tabs li
{
    font-size:18px;
  
}
.container-fluid .card [class*=card-header-]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
    border-radius: 3px;
    margin-top: -20px;
    padding: 1px;
    padding-left: 10px;
    height: 33px;
    padding-top: -25px;
}
.container-fluid .card-title1 {
    color: #fff;
    padding-top: -3px;
    position: relative;
    top: 0px;
    font-size: 16px;
}
#MainContent_chtCategoriesProductCountBarChart
{
    height:150px !important;
}
.container-fluid .card-stats .card-header.card-header-icon i {
    font-size: 34px;
    line-height: 40px;
    width: 42px;
    height: 42px;
    text-align: center;
}
.container-fluid .card
{
    margin-top:0px;
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
    padding: 8px 8px;
    vertical-align: middle;
    border-color: #ddd;
}
.checkbox-custom label, .radio-custom label {
    min-height: 22px;
    margin-bottom: 0;
    font-weight: 300;
    cursor: pointer;
    color: #757575;
}
.content {
  height: 100%;
}
.row-flex {
  display: flex;
  flex-wrap: wrap;
}
#MainContent_GridView1 tr th
{
    background:#fff !important;
    border:1px solid #ddd !important;
    color:#000 !important;
    font-weight:600 !important;
}
#MainContent_Grid1 tr th
{
      background:#fff !important;
    border:1px solid #ddd !important;
    color:#000 !important;
    font-weight:600 !important;  
}
.label-message
{
    background:red;
    color:#fff;
    padding:6px;
    position:fixed;
    bottom:0px;
    width:auto;
}
.modal-content{
              border:none;
          }
          .modal-header{
              padding: 5px 15px 5px 15px;
          }
          .modal-dialog{
              width: 800px;
          }
@media (min-width:0px) and (max-width: 767px) 
{
img#MainContent_chtCategoriesProductCountBarChart {
    height: 150px !important;
    width: 100% !important;
}

.container {

    margin-left: 0px !important;
    margin-top: -76px;

}
.site-menubar {

    position: fixed;
    top: 66.01px;
    z-index: 1400;
    width: 30%;
    height: 100%;
    height: -webkit-calc(100% - 66.01px);
    height: calc(100% - 66.01px);
    font-family: Roboto,sans-serif;
    color: rgba(117,117,117,.9);
    background: #fff;
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.08);
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    left: 130px;

}
}
.caption i:hover{
    display:block;
}

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
    padding: 8px 8px !important;
    vertical-align: middle;
    border-color: #ddd;
}
   .modal-dialog{
       width:600px!important;
       max-width:550px!important;
   }
   .camif{
       width:330px!important;
       max-width:330px!important;
   }
   .modal label{
       padding:0px!important;
   }
   .form-control,select.form-control:not([size]):not([multiple]){
       width: -webkit-fill-available;
       height:2rem;
       padding:2px 5px;
   }
   
        
        .filebutton{
            position: absolute!important;
            left: 42%;
            top: 0%!important;
        }
   </style>
    <script>
    function scrollDown() {
        document.getElementById('MainContent_GridView1').scrollTop = document.getElementById('MainContent_GridView1').scrollHeight
    }
</script><br /> 
    <div class="main-panel">
  <div class="content">
        <div class="container-fluid" id="departmentlist" runat="server">

      <div class="row dash-pane2" style="margin-top:80px!important;">	
          <div class="col-lg-5 px-0">
              <div class="card">
                  <div class="card-header" runat="server">
                      <h4 class="card-title card-header-warning" id="cardheadergreen" style="height: 30px!important; padding-top: 5px;"><i class="fa fa-users"></i>&emsp;<asp:Label ID="lblListofvisitors" runat="server" Text="Visitors"></asp:Label></h4>
                  </div>
                  <div class="card-body table-responsive" style="height: 505px; padding-top: 0px; padding-bottom: 0px;">
                      <div>
                          <input type="text" id="visitrname" class="form-control" style="display: inline; margin-bottom: 10px; width: 65%" placeholder="Search" aria-label="Search" />
                          <asp:CheckBox ID="CheckBox1" runat="server" Text="Sign Out with Remark" Style="display: inline; font-weight: 300!important;" Font-Bold="True" AutoPostBack="True" />
                      </div>
   <div style="overflow-y:scroll;height:455px">
                      <asp:GridView ID="Grid1" runat="server" class="table table-bordered table-hover table-striped"
          AutoGenerateColumns="False"  DataKeyNames="id" OnRowCommand="Grid1_RowCommand"  >
         
         
              <Columns>
              
             
             <asp:BoundField DataField="VisitorNAme" HeaderText="Visitor Name" SortExpression="EmpCode">
              
            </asp:BoundField>
            <asp:BoundField DataField="contactNumber" HeaderText="Contact Number" SortExpression="Dept_Name">
               
            </asp:BoundField>
          
            <asp:BoundField DataField="Visitorcompany" HeaderText="Visitor Company" SortExpression="DateofJoin">
               
         </asp:BoundField>
              <asp:BoundField DataField="EntryDate" HeaderText="EntryDate" SortExpression="Branch">
               
            </asp:BoundField>

                    <asp:BoundField DataField="InTime" HeaderText="InTime" SortExpression="Branch">
               
            </asp:BoundField>

                    <asp:BoundField DataField="OutTime" HeaderText="OutTime" SortExpression="Branch">
               
            </asp:BoundField>
                      <%-- <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Branch">
               
            </asp:BoundField>--%>
        <asp:TemplateField ShowHeader="true">
            <ItemTemplate>
                <asp:Button ID="Button1" runat="server" CausesValidation="false" CssClass="Button1" CommandName="SendMail" Width="60" ForeColor="white" Font-Bold="true"
                    Text='<%# Eval("Status") %>' CommandArgument='<%# Eval("id") %>' BackColor="#4CAF50" BorderStyle="None" style="cursor:pointer;border-radius:3px;letter-spacing:0.3px" />
            </ItemTemplate>
        </asp:TemplateField>

                 <%--  <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Branch">
               
            </asp:BoundField>--%>
                
                   
               
            

           </Columns>
         
      </asp:GridView>
       </div>

                            </div>
                        </div>
          </div>
          <div class="modal fade" id="camerapop" role="document">
              <div class="modal-dialog camif" role="document">
                  <div class="modal-content">
                      <div class="modal-header text-center">
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                              <span aria-hidden="true">&times;</span>
                          </button>
                          <h5 class="modal-title">Visitor Image Capture</h5>
                      </div>
                      <div class="modal-body text-center">
                          <video id="video">Camera not available.</video>
                      </div>
                      <div class="modal-footer" style="text-align: center;">
                          <button id="startbutton" class="btn btn-danger" data-dismiss="modal">Snap Photo</button>
                      </div>
                  </div>
              </div>
          </div>
                    <div class="col-lg-7 pr-0">
                        <div class="card">
                       <div class="card-header" runat="server">
                  <h4 class="card-title card-header-warning" id="visitrform" style="height:30px!important;padding-top:5px;"><i class="fa fa-user"></i>&emsp;<asp:Label ID="Label3" runat="server" Text="Visitor's Registration Form"></asp:Label></h4>
                </div>
                        <div class="card-body" style="height:505px;">
                          <%--  <form action="" method="post">--%>
                                <div class="row">
                                    <div class="col-12">
                                        <div class="card">
                                            <div class="card-header">
                                                <h5 class="card-title">Visitor's Info</h5>
                                                <hr width="75%" align="left" />
                                            </div>
                                            <div class="card-body" style="padding-top:0px;">
                                            
                                                <div class="row">
                                                     <div class="col-md-3">
                                                    <asp:Label ID="Label6" runat="server" Text="Contact Number"></asp:Label> <span class="text-danger">*</span>
                                                    <asp:TextBox ID="txtContactNumber" runat="server" class="form-control phone" AutoPostBack="True" OnTextChanged="txtContactNumber_TextChanged" onkeypress="return NumberOnly()" maxlength="10" ></asp:TextBox>
                                                </div>
                                                  <div class="col-md-3 pl-0">
                                                    <asp:Label ID="lblEmployeeName" runat="server" Text="Visitor Name"></asp:Label> <span class="text-danger">*</span>
                                                    <asp:TextBox ID="txtVisitorName" runat="server" class="form-control" ></asp:TextBox>
                                                    </div>
                                                  <div class="col-md-3 pl-0">
                                                    <asp:Label ID="Label4" runat="server" Text="Company Name"></asp:Label>
                                                    <asp:TextBox ID="txtVisitorCompany" runat="server" class="form-control" ></asp:TextBox>
                                                </div>
                                                  
                                                    <div class="col-md-3">
                                                        <div class="profile-img" style="margin-top: -35px;">
                                                            <div class="caption">
                                                                <label class="filebutton">
                                                                    <i class="fa fa-camera fa-2x mt-15" data-toggle="modal" data-target="#camerapop"></i>
                                                                </label>
                                                            </div>
                                                            <div class="camera" style="display: none;">
                                                            </div>
                                                            <canvas id="canvas" style="display: none;"> </canvas>
                                                            <div class="output">
                                                                <asp:Image ID="photo" runat="server" alt="Profile" ImageUrl="~/images/profile-icon.png" style="height: 100px; width: 140px; border-radius: 5px;"  />
                                                                <%--<img id="photo" alt="Profile" style="height: 100px; width: 100px; border-radius: 5px;" />--%>
                                                                <asp:HiddenField ID="HiddenField1" runat="server" />
                                                            </div>
                                                            <%--<img id="output" runat="server" src="~/images/profile-icon.png" style="width:100%;border-radius:5px;width:100px;"/>--%>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-9" style="margin-top:-12px;">
                                                        <div class="row">
                                                            <div class="col-4">
                                                    <asp:Label ID="Label5" runat="server" Text="Address"></asp:Label> <span class="text-danger">*</span>
                                                    <asp:TextBox ID="txtAddress" runat="server" class="form-control" ></asp:TextBox>
                                                </div>                                                
                                                <div class="col-4 pl-0">
                                                    <asp:Label ID="Label7" runat="server" Text="Email"></asp:Label>
                                                    <asp:TextBox ID="txtEmailaddress" runat="server" class="form-control" type="email" ></asp:TextBox>
                                                </div>
                                                <div class="col-4 pl-0">
                                                    <asp:Label ID="Label8" runat="server" Text="ID Proof"></asp:Label>
                                                    <asp:DropDownList ID="cboIdProofCategory" runat="server" class="form-control">
                                                        <asp:ListItem>Voter Id</asp:ListItem>
                                                        <asp:ListItem>Aadhar Card</asp:ListItem>
                                                        <asp:ListItem>Driving License</asp:ListItem>
                                                        <asp:ListItem>Passport</asp:ListItem>
                                                        <asp:ListItem>Others</asp:ListItem>

                                                    </asp:DropDownList>
                                                </div>
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="col-md-3 pr-0">
                                                        <asp:Label ID="Label9" runat="server" Text="ID Proof Details"></asp:Label> <span class="text-danger">*</span>
                                                        <asp:TextBox ID="txtIdProof" runat="server" class="form-control"></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-3">
                                                        <asp:Label ID="Label10" runat="server" Text="Accessories"></asp:Label>
                                                        <asp:TextBox ID="txtAccessories" runat="server" class="form-control" ></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-3 pl-0">
                                                        <asp:Label ID="Label11" runat="server" Text="Issue Card number"></asp:Label>
                                                        <asp:TextBox ID="txtNumberofIssueCard" runat="server" class="form-control" ></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-3 pl-0">
                                                        <asp:Label ID="Label12" runat="server" Text="Card Validity in (HH:mm)"></asp:Label>
                                                       <%-- <asp:DropDownList runat="server" CssClass="form-control" ID="cbocarddvalidity"></asp:DropDownList>--%>
                                                         <asp:TextBox ID="cbocarddvalidity" runat="server" class="form-control" pattern="([01]?[0-9]|2[0-3]):[0-5][0-9]" oninvalid="this.setCustomValidity('Please enter time less than 24:00')" oninput="setCustomValidity('')">00:30</asp:TextBox>
                                                    </div>
                                                    <div class="col-md-3 pr-0">
                                                        <asp:Label ID="Label13" runat="server" Text="Status"></asp:Label>
                                                        <asp:DropDownList runat="server" CssClass="form-control" ID="cboStatus">
                                                            <asp:ListItem>Sign In</asp:ListItem>
                                                            <asp:ListItem>Sign Out</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </div>
                                                    </div>
                                                    </div>
                                                </div>
                                            </div>
                                    <div class="col-10">
                                        <div class="card">
                                            <div class="card-header">
                                                <h5 class="card-title">Visitor's Purpose  to Meet </h5>
                                                <hr />
                                            </div>
                                            <div class="card-body"style="padding-top:0px;">
                                                <div class="row" style="padding-top:0px;">
                                                   
                                                    <div class="col-md-4">
                                                        <asp:Label ID="Label15" runat="server" Text="Department"></asp:Label>
                                                        <asp:DropDownlist runat="server" CssClass="form-control" ID="cboDeptid"></asp:DropDownlist>
                                                    </div>
                                                    <div class="col-md-4">
                                                        <asp:Label ID="Label16" runat="server" Text="Designation"></asp:Label>
                                                        <asp:DropDownlist runat="server" CssClass="form-control" ID="cboDesigid"></asp:DropDownlist>
                                                    </div>
                                                     <div class="col-md-4">
                                                        <asp:Label ID="Label14" runat="server" Text="Meeting Person"></asp:Label>
                                                        <asp:DropDownlist runat="server" CssClass="form-control" ID="cboToMeet"></asp:DropDownlist>
                                                    </div>

                                                    <div class="col-md-4">
                                                        <asp:Label ID="Label17" runat="server" Text="Floor Number"></asp:Label>
                                                        <asp:TextBox ID="txtFloorNo" runat="server" class="form-control"  ></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-4">
                                                        <asp:Label ID="Label18" runat="server" Text="Purpose"></asp:Label> <span class="text-danger">*</span>
                                                        <asp:TextBox ID="visitper" runat="server" class="form-control"></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-4">
                                                        <asp:Label ID="Label19" runat="server" Text="Remark"></asp:Label>
                                                        <asp:TextBox ID="txtRemark" runat="server" class="form-control" ></asp:TextBox>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-2" style="margin:auto;">
                                          
                               <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header" style="display:block;text-align:center;">
              <button type="button" class="close" data-dismiss="modal" onclick="lvref()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <asp:Label ID="lblcompvisitpass" runat="server" Text="" CssClass="h4 font-weight-800 mb-0 d-block"></asp:Label>
                <asp:Label ID="lblopname" runat="server" Text="Visitor Pass" CssClass="h5 text-muted font-weight-600"></asp:Label>
            </div>          
            <div class="modal-body py-2" id="printdiv">
                <div class="row" >
                    <div class="col-lg-2 col-md-2 col-sm-2">
                        <div class="row asc">
                            <div class="col-sm-12 px-0">
                                <%--<img id="savedimg" alt="visitor image" src="images/profile-icon.png" style="height:100px;width:100px;border-radius:5px;">--%>
                                <asp:Image ID="savedimg" runat="server" ImageUrl="~/images/profile-icon.png" style="height:100px;width:100px;border-radius:5px;z-index:2;" />
                                <p style="display:inline">Date:</p>
                                <p style="display:inline">
                                    <asp:Label ID="lbldate" runat="server" Text="" style="white-space:nowrap;color:#000;"></asp:Label> </p><br />
                                <p style="display:inline">Time:</p>
                                <p style="display:inline">    <asp:Label ID="lbltime" runat="server" Text="" style="white-space:nowrap;color:#000;"></asp:Label> </p>
                                <p>Visitor Sign.</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-10 col-sm-10 col-md-10">
                        <div class="row">
                        <div class="col-sm-3">
                            <label style="margin-right:-5px;">Gate Pass No.</label>
                            <p>    <asp:Label ID="lblgatepassno" runat="server" Text="" ></asp:Label> </p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Visitor Name</label>
                            <p>    <asp:Label ID="lblvisitorname" runat="server" Text=""></asp:Label> </p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Organization</label>
                            <p>    <asp:Label ID="lblcompany" runat="server" Text=""></asp:Label> </p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Contact</label>
                            <p> <asp:Label ID="lblcontactno" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col asl" style="min-width:97%;margin-left:13px;margin-bottom:10px;margin-top:-10px;background-color:#f7f7f7;display:inherit;border-radius:10px;z-index:0;">
                            <label style="margin-top:8px;font-size:13px;">To meet :</label>
                            <p class="mb-0"><asp:Label ID="lbltomeet" runat="server" Text="" style="display:inherit;margin-left:10px;margin-top:4px;"></asp:Label></p>
                        </div>
                        <div class="col-sm-3">
                            <label>Department</label>
                            <p><asp:Label ID="lbldepartment" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Designation</label>
                            <p><asp:Label ID="lbldesignation" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Purpose</label>
                            <p><asp:Label ID="lblperpose" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Valid Time</label>
                            <p><asp:Label ID="lblvalidtime" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col-sm-3">
                            <label>Accessories</label>
                            <p><asp:Label ID="lblaccessories" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Access Zone</label>
                            <p><asp:Label ID="lblfloorno" runat="server" Text=""></asp:Label></p>
                        </div>
                        <div class="col-sm-3 pl-0">
                            <label>Card No.</label>
                            <p> </p>
                        </div>
                        
                            </div>
                    </div>
                   <%-- <div class="col-lg-2" style="padding:0px;display:none;">
                       <%-- <label>QR</label>
                        <img src="images/qr-code.png" style="width:100%" />--%>
                        <%--<label>Host sign.</label>
                    </div>--%>
                </div>
            </div>
            <div class="modal-footer pb-2" style="text-align:left">
                <div class="row" style="width:100%;">
                    <div class="col-lg-2" style="visibility:hidden;">
                        <label>Prepared By:</label>
                    </div>
                    <div class="col-lg-2" style="visibility:hidden;">
                        <label> </label>
                    </div>
                    <div class="col-lg-5" style="visibility:hidden;">
                        <label>Authorized By:</label>
                    </div>
                    <div class="col-lg-3" style="text-align:right;padding-right:20px;">
                        <%--<button type="button" class="btn btn-default" onclick="loadvisitimg()">loadimg</button>--%>
                        <button type="button" class="btn btn-primary"  onclick="PrintDiv();">Print Pass</button>
                    </div>
                </div>
            </div>
          </div>
        </div>
      </div>

        <asp:Button ID="BtnSave" runat="server" Text="Save" class="btn btn-animate-vertical btn-success" OnClientClick="return multi()" OnClick="BtnSave_Click"  />
                                              </ContentTemplate>

    </asp:UpdatePanel>
                                        <%--<asp:Button ID="BtnSave" runat="server" Text="Save"  class="btn btn-animate-vertical btn-success" OnClick="BtnSave_Click" OnClientClick="Confirm()"/>--%>
                                        
                                         
                                    </div>
                                </div>
                           <%-- </form>--%>
                        </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <%-- <script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>--%>
     <script type = "text/javascript">

         function PrintDiv() {
             var divContents = document.getElementById("myModal").innerHTML;
             var printWindow = window.open('', '', 'height=500,width=900');
             //WindowObject.document.writeln(DocumentContainer.innerHTML);
             printWindow.document.write('<html><head><title></title>');
             printWindow.document.write('<link rel=stylesheet href="css/bootstrap.minfd53.css">');
             printWindow.document.write('<style>@page { size: auto;  margin: 0mm; }@media print{html,body{height:100vh;overflow:hidden}}@page :header{display:none;margin-top:0px;}body{font-size:12px}img{height:70px;width:50px}button{display:none!important}.modal-dialog{margin-top:10px!important;}.modal-header{padding-bottom:0!important}.modal-body{padding:0;padding-top:10px}@media print{.asl{background-color:#f7f7f7!important; -webkit-print-color-adjust: exact;border-radius:10px;}}#MainContent_lbltomeet{margin-top:9px!important;}label{margin-bottom:2px;}.modal-dialog{max-width:700px;}.asc{margin-left:0px;}</style>');
             printWindow.document.write('</head><body>');
             printWindow.document.write(divContents);
             printWindow.document.write('</body></html>');
             //printWindow.document.close();
             setTimeout(() => {  printWindow.print(); }, 500);
             
         }  


        function Confirm() {
            var confirm_value = document.createElement("INPUT");
            confirm_value.type = "hidden";
            confirm_value.name = "confirm_value";
            if (confirm("Do you want to Print  Pass?")) {
                confirm_value.value = "Yes";
            } else {
                confirm_value.value = "No";
            }
            document.forms[0].appendChild(confirm_value);
         }

          function openModal() {
            $('#myModal').modal('show');
         };
     </script>
    <script type="text/javascript" src="js/capture.js"></script>
    <%--<script type="text/javascript" src="quicksearch.js"></script>--%>
    <script type="text/javascript">
        
        function multi() {
            validate();
            loadvisitimg();
        }
        function validate() { 
            var textvar = document.getElementById("<%=txtVisitorName.ClientID %>").value;
            if (textvar == "") {
                alert("Please enter the Visitor's Name");
                document.getElementById("<%= txtVisitorName.ClientID %>").focus();
                return false;
            }
            var textvar = document.getElementById("<%=txtAddress.ClientID %>").value;
            if (textvar == "") {
                alert("Please enter the Visitor's Address");
                document.getElementById("<%= txtAddress.ClientID %>").focus();
                return false;
            }
            var textvar = document.getElementById("<%=txtContactNumber.ClientID %>").value;
            if (textvar == "") {
                alert("Please enter the Visitor's Contact Number");
                document.getElementById("<%= txtContactNumber.ClientID %>").focus();
                return false;
            }
            var textv = document.getElementById("<%=txtIdProof.ClientID %>").value;
            if (textv == "") {
                alert("Please enter the Visitor's id Proof Details");
                document.getElementById("<%= txtIdProof.ClientID %>").focus();
                return false;
            }
            var textw = document.getElementById("<%=visitper.ClientID %>").value;
            if (textw == "") {
                alert("Please enter the Visitor's Purpose");
                document.getElementById("<%= visitper.ClientID %>").focus();
                return false;
            }
            var im = document.getElementById("MainContent_photo").src;
            var imgsav = document.getElementById("MainContent_savedimg");
            imgsav.src = im;
            var hi = document.getElementById("MainContent_HiddenField1");
            hi.value = im;
        }

        function loadvisitimg() {
            var im = document.getElementById("MainContent_photo").src;
            var imgsav = document.getElementById("MainContent_savedimg");
            imgsav.src = im;
            return true;
        }

        function NumberOnly() {
        var AsciiValue = event.keyCode
        if ((AsciiValue >= 48 && AsciiValue <= 57) || (AsciiValue == 8 || AsciiValue == 127))
            event.returnValue = true;
        else
            event.returnValue = false;
        }

        window.onload = function () {
            var sis = document.getElementsByClassName('Button1');
            for (var t=0; t < sis.length; t++) {
                if (sis[t].value == "Sign Out") {
                    sis[t].setAttribute("disabled",false);
                sis[t].style.backgroundColor = "#b5b5b5";
            }
            }
        }
        function lvref() {
            window.location.replace("vtms.aspx");
        }
        
    </script>

</asp:Content>
